<template>
  <div>
    <div>
      <van-cell
        v-for="val in values"
        :key="val.name"
        :title="val.title"
        :icon="val.icon"
        is-link
        :value="val.value && val.value()"
        :to="val.path"
      />

      <van-cell
        title="test"
        icon="/dev-api/web/image?model=res.country&id=48&field=image&unique=06202020092749"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeMe',
  components: {},
  directives: {},
  filters: {},

  data() {
    return {
      values: [
        {
          path: '/erp/partner/list',
          title: '客户',
          name: 'Customers',
          icon: 'friends-o'
        },
        {
          path: '/erp/product/list',
          title: '产品',
          name: 'Products',
          icon: 'goods-collect-o',
          value: () => {
            return this.$store.state.ProductProduct.dataCount
          }
        },
        { path: '/erp/sales', title: '订单', name: 'Orders', icon: 'orders-o' }
      ]
    }
  },
  computed: {},
  async created() {
    // const res =
    await this.$store.dispatch('ProductProduct/search_count')
    // console.log(res)
  },

  methods: {
    async onClick() {}
  }
}
</script>

<style type="text/css"></style>
